CC = g++ -nostartfiles -fno-rtti -nostdlib -fno-exceptions -fno-stack-protector -I ./include
ASM = nasm -f elf
OBJLIST = boot.o kernel.o memoire.o ecrantexte.o gdt.o assembleur.o

all: clean kernel
	@echo Compilation reussie !!!

kernel: ${OBJLIST}
	ld -T link.ld -o kernel ${OBJLIST}

clean:
	-rm ${OBJLIST} kernel

boot.o: boot.s
	${ASM} -o boot.o boot.s

kernel.o: kernel.cpp
	${CC} -o kernel.o -c kernel.cpp

memoire.o: memoire.cpp
	${CC} -o memoire.o -c memoire.cpp

ecrantexte.o: ecrantexte.cpp
	${CC} -o ecrantexte.o -c ecrantexte.cpp

gdt.o: gdt.cpp
	${CC} -o gdt.o -c gdt.cpp

assembleur.o: assembleur.s
	${ASM} -o assembleur.o assembleur.s